{ "cells": [ { "cell_type": "markdown", "metadata": { "toc": true }, "source": [ "

Table of Contents

\n", "
" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Voici une liste de programmes à transcrire en langage machine.
\n", "Vous testerez vos prohrammes en utilisant le simaleur : \n", "\t\t\t\t\thttp://www.peterhigginson.co.uk/LMC/
\n", "Remarque importante : le langage macine dépend de la machine. Il existe différentes syntaxes en fonction des processeurs utilisés." ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "The AQA Instruction Set.\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "\n", "" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Exercice 1 : affectation

" ] }, { "cell_type": "code", "execution_count": 2, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "7\n" ] } ], "source": [ "a=3\n", "b=4\n", "c=a+b\n", "print(c)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "votre solution ici : \n", "\n", "\n", "\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Exercice 2 : affectation et lecture d'un nombre

" ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [ "a=int(input())\n", "b=int(input())\n", "c=a+b\n", "print(c)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "votre solution ici : \n", "\n", "\n", "\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Exercice 2 : structure conditionnelle

" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "-3\n", "3\n" ] } ], "source": [ "x=int(input())\n", "if x>0 :\n", " print(x)\n", "else :\n", " y=-x\n", " print(y)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "votre solution ici : \n", "\n", "\n", "\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Exercice 3 : répétition WHILE

" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "5\n" ] } ], "source": [ "x=1\n", "while x<5:\n", " x=x+2\n", "print(x)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "votre solution ici : \n", "\n", "\n", "\n", "\n", "\n" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "

Des idées d'exercices

" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "Vous pouvez utiliser les algorithmes que vous avez traités dans la section algorithmes (pseudo code).
\n", "Attention à ne pas vous lancer dans des exercices compliqués." ] }, { "cell_type": "code", "execution_count": null, "metadata": {}, "outputs": [], "source": [] } ], "metadata": { "hide_input": false, "kernelspec": { "display_name": "Python 3", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.7.3" }, "latex_envs": { "LaTeX_envs_menu_present": true, "autoclose": false, "autocomplete": true, "bibliofile": "biblio.bib", "cite_by": "apalike", "current_citInitial": 1, "eqLabelWithNumbers": true, "eqNumInitial": 1, "hotkeys": { "equation": "Ctrl-E", "itemize": "Ctrl-I" }, "labels_anchors": false, "latex_user_defs": false, "report_style_numbering": false, "user_envs_cfg": false }, "toc": { "base_numbering": 1, "nav_menu": {}, "number_sections": true, "sideBar": true, "skip_h1_title": true, "title_cell": "Table of Contents", "title_sidebar": "Contents", "toc_cell": true, "toc_position": {}, "toc_section_display": true, "toc_window_display": false } }, "nbformat": 4, "nbformat_minor": 2 }